Using the Collection Server Control Programmatically Example

The following is an example of using code behind, and a drag and drop Collection server control to display random content from a collection.

  1. Drag and drop a Collection server control on your Web form.
  2. Set the properties in the properties window.

    Note: In this example, the Random and GetHtml properties must be set to True.

    Show me.

  3. Add the following code to the code behind.
    Dim str As String
    str = "<h1>Hello There</h1><br>"
    str &= Collection1.EkItems(0).Html
    Collection1.Text = str
  4. Build and browse your web form.
    Show me.

Previous TopicNext Topic|